# -*- coding:utf-8 -*-
import xlwt
 
 
font1 = xlwt.Font()
font1.colour_index = 2
 
pattern_yellow = xlwt.Pattern()  # 创建pattern
pattern_yellow.pattern = xlwt.Pattern.SOLID_PATTERN  # 设置填充模式为全部填充
pattern_yellow.pattern_fore_colour = 5
 
borders = xlwt.Borders()  # 创建borders
borders.left = xlwt.Borders.THIN  # 设置边框的类型为细线
borders.right = xlwt.Borders.THIN
borders.top = xlwt.Borders.THIN
borders.bottom = xlwt.Borders.THIN
#细边框styleCommon
styleCommon = xlwt.XFStyle()
styleCommon.borders = borders
#填充颜色 styleSpec ，用于比对不相等
styleSpec = xlwt.XFStyle()
styleSpec.font = font1
styleSpec.pattern = pattern_yellow

styleCommon.alignment.wrap = styleCommon.alignment.WRAP_AT_RIGHT
styleCommon.alignment.vert = styleCommon.alignment.VERT_TOP
# styleCommon.alignment.
# styleCommon.alignment.shri = True

styleCenter = xlwt.XFStyle()
styleCenter.alignment.vert = styleCenter.alignment.VERT_CENTER
styleCenter.alignment.horz = styleCenter.alignment.HORZ_CENTER

